<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="log" uri="http://logging.apache.org/log4j/tld/log" %>

<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 13-6-12
  Time: 下午10:19
  To change this template use File | Settings | File Templates.
--%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>生成试卷</title>
    <link type="text/css" href="<%=basePath%>/css/base.css" rel="stylesheet"/>
    <script type="text/javascript" src="<%=basePath%>js/jquery.min.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/menu.js"></script>
    <script src='<%=basePath%>dwr/util.js' type= "text/javascript" ></script>
    <script src='<%=basePath%>dwr/engine.js' type= "text/javascript" ></script>
    <script src='<%=basePath%>dwr/interface/subjectService.js' type= "text/javascript" ></script>
    <script type="text/javascript" src="<%=basePath%>/js/jquery.js"></script>
    <script src='<%=basePath%>js/subject.js' type= "text/javascript" ></script>
    <style type="text/css">
        #content form table tr td {
            text-align: left;
            width: 80px;
            height: 40px;
        }
    </style>
    <script type="text/javascript">
        function sum() {
            var choiceScore = Number(document.getElementById("choiceScore").value.toString());
            var choiceNum = Number(document.getElementById("choiceNum").value.toString());
            var mutiChoiceScore = Number(document.getElementById("mutiChoiceScore").value.toString());
            var mutiChoiceNum = Number(document.getElementById("mutiChoiceNum").value.toString());
            var judgeScore = Number(document.getElementById("judgeScore").value.toString());
            var judgeNum = Number(document.getElementById("judgeNum").value.toString());
            var fillScore = Number(document.getElementById("fillScore").value.toString());
            var fillNum = Number(document.getElementById("fillNum").value.toString());
            var askScore = Number(document.getElementById("askScore").value.toString());
            var askNum = Number(document.getElementById("askNum").value.toString());
            var sum = choiceScore * choiceNum + mutiChoiceScore * mutiChoiceNum+judgeScore * judgeNum + fillScore * fillNum +
                    askScore * askNum;
            document.getElementById("sumScore").value = sum;
        }
    </script>

</head>
<body>
<%@ include file="/page/share/menu.jsp" %>

<div id="content">
    <h2>生成试卷</h2>
    <hr>
    <form action="TestPaper!randomTestPaper.action" method="post">
        <input type="hidden" name="owner" value="${person.accout}"/>
        <table style="margin-left: 350px;">
            <tr>
                <td>
                    试卷名称
                </td>
                <td>
                    <input type="text" name="testName" size="24">
                </td>
            </tr>
            <tr>
                <td>
                    总分
                </td>
                <td>
                    <input type="text" readonly="readonly" name="sumScore" size="24" id="sumScore">
                </td>
            </tr>
            <tr>
                <td>
                    考试科目
                </td>
                <td>
                    <select id="subject" name="subject"
                            style="width: 200px;height: 30px;font-family: '微软雅黑';font-size: 16px;"></select>
                </td>
            </tr>
        </table>
        <table style="margin-left: 350px;">
            <tr>
                <td>&nbsp;&nbsp;题型</td>
                <td>每题分值</td>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;题数</td>
            </tr>
            <tr>
                <td>单选题</td>
                <td><input type="text" name="choiceScore" size="6" id="choiceScore" onchange="sum()"></td>
                <td><input type="text" name="choiceNum" size="6" id="choiceNum" onchange="sum()"></td>
            </tr>
            <tr>
                <td>多选题</td>
                <td><input type="text" name="mutiChoiceScore" size="6" id="mutiChoiceScore" onchange="sum()"></td>
                <td><input type="text" name="mutiChoiceNum" size="6" id="mutiChoiceNum" onchange="sum()"></td>
            </tr>
            <tr>
                <td>判断题</td>
                <td><input type="text" name="judgeScore" size="6" id="judgeScore" onchange="sum()"></td>
                <td><input type="text" name="judgeNum" size="6" id="judgeNum" onchange="sum()"></td>
            </tr>
            <tr>
                <td>填空题</td>
                <td><input type="text" name="fillScore" size="6" id="fillScore" onchange="sum()"></td>
                <td><input type="text" name="fillNum" size="6" id="fillNum" onchange="sum()"></td>
            </tr>
            <tr>
                <td>问答题</td>
                <td><input type="text" name="askScore" size="6" id="askScore" onchange="sum()"></td>
                <td><input type="text" name="askNum" size="6" id="askNum" onchange="sum()"></td>
            </tr>
            <%--<tr>--%>
            <%--<td >综合题</td>--%>
            <%--<td><input type="text" name="comScore" size="6"></td>--%>
            <%--<td><input type="text" name="comNum" size="6"></td>--%>
            <%--</tr>--%>
            <tr>
                <td></td>
                <td>
                    <input type="submit" value="生成试卷"  onMouseOver="this.style.background='#2569c1'" onmouseout="this.style.background='#114a93'" style="width:200px;height:30px;cursor:pointer;border: none;background: #2569c1;color: white;font-size: 16px;" />
                </td>
            </tr>
        </table>
    </form>







</div>


<div id="footer">
    <p style="text-align: center;color: #757575;padding: 20px 0px 0px 0px; font:12px;">Copyright © 2010-2013 蓝天白云团队
        版权所有</p>
</div>
</body>
</html>